home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_dos.lha / dos / sphsrc / sph_util.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-26  |  1.2 KB  |  69 lines

  1. #include "HEADERS.h"
  2. #include "sphigslocal.h"
  3.  
  4. /** Functions creating geometric data 
  5. **/
  6.  
  7. double *SPH_defPoint (pt,  x, y, z)
  8. double *pt;  /* SHOULD ALREADY POINT TO AN ARRAY OF 3 DOUBLES */
  9. double x, y, z;
  10. {
  11.    pt[0] = x;
  12.    pt[1] = y;
  13.    pt[2] = z;
  14.    return pt;
  15. }
  16.  
  17.  
  18. NDC_rectangle SPH_defNDCrectangle (left_x, bottom_y, right_x, top_y)
  19. double left_x, bottom_y, right_x, top_y;
  20. {
  21.    NDC_rectangle rect;
  22.  
  23.    rect.bottom_left.x = left_x;
  24.    rect.bottom_left.y = bottom_y;
  25.    rect.top_right.x = right_x;
  26.    rect.top_right.y = top_y;
  27.    return rect;
  28. }
  29.  
  30.  
  31.  
  32.  
  33. /** INTERNAL UTILITIES
  34. The below functions perform operations on "intelligent rectangles":
  35.    SRGP rectangles that "know" whether they are empty.
  36.  
  37.  
  38.  
  39.             CURRENTLY   ALL     COMMENTED   OUT
  40.  
  41. void
  42. SPH_clip_intelligent_rectangle (ir, sr)
  43. intelligent_rectangle *ir;
  44. srgp__rectangle sr;
  45. {
  46.    if (ir->nonempty) {
  47.       if (GEOM_computeRectIntersection (ir->rect, sr, &(ir->rect)))
  48.      ir->nonempty = TRUE;
  49.       else
  50.      ir->nonempty = FALSE;
  51.    }
  52. }
  53.  
  54.  
  55.  
  56. void
  57. SPH_expand_intelligent_rectangle (ir, sr)
  58. intelligent_rectangle *ir;
  59. srgp__rectangle sr;
  60. {
  61.    if (ir->nonempty)
  62.       GEOM_computeRectUnion (ir->rect, sr, &(ir->rect));
  63.    else
  64.       ir->rect = sr;
  65.  
  66.    ir->nonempty = TRUE;
  67. }
  68.    **/
  69.